#include <iostream>
using namespace std;

/*
    【题目212】定义一个国家基类Country,包含国名、首都、人口等属性，
            派生出省类Province,增加省会城市、人口数量属性。
*/

class Country
{
public:
    Country(string _countryName, string _capital, double _countryPopulation )
    {
        countryName = _countryName;
        capital = _capital;
        countryPopulation = _countryPopulation;
    }
    Country(){}
    void show()
    {
        cout << "国家名称：" << countryName << endl;
        cout << "首都：" << capital << endl;
        cout << "人口：" << countryPopulation << endl;
    }
private:
    string countryName;
    string capital;
    double countryPopulation;

};
class Province : public Country
{
public:
    Province(string _provincialCapital, int _population)    
    {
        provincialCapital = _provincialCapital;
        population = _population;
    }    
    void show()
    {
        cout << "省会：" << provincialCapital << endl;
        cout << "人口：" << population << endl;
    }
private:
    string provincialCapital;
    int population;
};

int main()
{
    Country country("中国", "北京", 1430000000);
    country.show();
    cout << "----------------------------------------------------------------" << endl;
    Province province("上海", 24150000);
    province.show();


    return 0;
}